home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Periodicals / CSMP / C.S.M.P. Digest, Issue 3.023 < prev    next >
Internet Message Format  |  1994-06-09  |  69KB

  1. From: pottier@clipper.ens.fr (Francois Pottier)
  2. Subject: csmp-digest-v3-023
  3. Date: Wed, 4 May 94 12:25:07 MET DST
  4.  
  5. C.S.M.P. Digest             Wed, 04 May 94       Volume 3 : Issue 23
  6.  
  7. Today's Topics:
  8.  
  9.         CCollaborator bug
  10.         Embedding PICTS in TextEdit?
  11.         How did YOU learn to program?
  12.         How do I get machine-user name?
  13.         How to: Aladdin-aware ResEdit (was Re: ResEdit + dctb = ID=01?)
  14.         Window -> PICT question
  15.  
  16.  
  17.  
  18. The Comp.Sys.Mac.Programmer Digest is moderated by Francois Pottier
  19. (pottier@clipper.ens.fr).
  20.  
  21. The digest is a collection of article threads from the internet newsgroup
  22. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  23. regularly and want an archive of the discussions.  If you don't know what a
  24. newsgroup is, you probably don't have access to it.  Ask your systems
  25. administrator(s) for details.  If you don't have access to news, you may
  26. still be able to post messages to the group by using a mail server like
  27. anon.penet.fi (mail help@anon.penet.fi for more information).
  28.  
  29. Each issue of the digest contains one or more sets of articles (called
  30. threads), with each set corresponding to a 'discussion' of a particular
  31. subject.  The articles are not edited; all articles included in this digest
  32. are in their original posted form (as received by our news server at
  33. nef.ens.fr).  Article threads are not added to the digest until the last
  34. article added to the thread is at least two weeks old (this is to ensure that
  35. the thread is dead before adding it to the digest).  Article threads that
  36. consist of only one message are generally not included in the digest.
  37.  
  38. The digest is officially distributed by two means, by email and ftp.
  39.  
  40. If you want to receive the digest by mail, send email to listserv@ens.fr
  41. with no subject and one of the following commands as body:
  42.     help                        Sends you a summary of commands
  43.     subscribe csmp-digest Your Name    Adds you to the mailing list
  44.     signoff csmp-digest            Removes you from the list
  45. Once you have subscribed, you will automatically receive each new
  46. issue as it is created.
  47.  
  48. The official ftp info is //ftp.dartmouth.edu/pub/csmp-digest.
  49. Questions related to the ftp site should be directed to
  50. scott.silver@dartmouth.edu. Currently no previous volumes of the CSMP
  51. digest are available there.
  52.  
  53. Also, the digests are available to WAIS users as comp.sys.mac.programmer.src.
  54.  
  55.  
  56. -------------------------------------------------------
  57.  
  58. >From jafl@cco.caltech.edu (John Lindal)
  59. Subject: CCollaborator bug
  60. Date: 18 Apr 1994 20:50:46 GMT
  61. Organization: California Institute of Technology, Pasadena
  62.  
  63. I just found a really nasty bug in CCollaborator:
  64.  
  65. CCollaborator::DependUpon
  66.  
  67. first line should be:
  68.  
  69. if (itsProviders && itsProviders->FindIndex(aProvider) > 0) return;
  70.  
  71. This prevents providers from appearing multiple times in the list!
  72.  
  73. John Lindal
  74.  
  75.  
  76. +++++++++++++++++++++++++++
  77.  
  78. >From u9119523@sys.uea.ac.uk (Graham Cox)
  79. Date: Tue, 19 Apr 1994 11:09:32 GMT
  80. Organization: School of Information Systems, UEA, Norwich
  81.  
  82. In article <2ourr6$ane@gap.cco.caltech.edu>, jafl@cco.caltech.edu (John
  83. Lindal) wrote:
  84.  
  85. > I just found a really nasty bug in CCollaborator:
  86. > CCollaborator::DependUpon
  87. > first line should be:
  88. > if (itsProviders && itsProviders->FindIndex(aProvider) > 0) return;
  89. > This prevents providers from appearing multiple times in the list!
  90. > John Lindal
  91.  
  92.  
  93. Ah, that explains it! Thanks- this one was really pissing me off, having to
  94. call CancelDependency before DependUpon every time- just in case.
  95.  
  96. - ------------------------------------------------------------------------
  97. Love & BSWK, Graham
  98.  
  99. -Everyone is entitled to their opinion, no matter how wrong they may be...
  100. - ------------------------------------------------------------------------
  101.  
  102. +++++++++++++++++++++++++++
  103.  
  104. >From u9119523@sys.uea.ac.uk (Graham Cox)
  105. Date: Tue, 19 Apr 1994 11:10:37 GMT
  106. Organization: School of Information Systems, UEA, Norwich
  107.  
  108. In article <2ourr6$ane@gap.cco.caltech.edu>, jafl@cco.caltech.edu (John
  109. Lindal) wrote:
  110.  
  111. > I just found a really nasty bug in CCollaborator:
  112. > CCollaborator::DependUpon
  113. > first line should be:
  114. > if (itsProviders && itsProviders->FindIndex(aProvider) > 0) return;
  115. > This prevents providers from appearing multiple times in the list!
  116. > John Lindal
  117.  
  118. Another thing I found, though this may have been fixed since v1.1, which I
  119. am using, is that the 'reason' code gets truncated to a short somewhere
  120. between BroadcastChange and ProviderChanged. This doesn't really cause a
  121. problem if you use the numbering scheme that THINK specify for reason
  122. codes, but I use four character strings as reason codes (I think this is
  123. much neater- easier to remember and much easier to keep unique) so it was a
  124. problem for me. The offending bug is caused somewhere in the bowels of the
  125. CCollaborator code, which defines a temporary struct called (I think)
  126. tInfo. Change the type of the reason field from short to long and all is
  127. well.
  128.  
  129. On a general note, I wonder just how acceptable it is that this stuff is
  130. occasionally a bit sloppy? For example, the CStdPopUpPane object is very
  131. poor- I had to rewrite lots of it to get it to work the way I expected it
  132. to. Another slap on the wrist for Symantec???
  133.  
  134. - ------------------------------------------------------------------------
  135. Love & BSWK, Graham
  136.  
  137. -Everyone is entitled to their opinion, no matter how wrong they may be...
  138. - ------------------------------------------------------------------------
  139.  
  140. ---------------------------
  141.  
  142. >From u9119523@sys.uea.ac.uk (Graham Cox)
  143. Subject: Embedding PICTS in TextEdit?
  144. Date: Tue, 19 Apr 1994 11:20:34 GMT
  145. Organization: School of Information Systems, UEA, Norwich
  146.  
  147. I want to embed a PICT in TextEdit automatically. The idea I have is to use
  148. an obscure char to indicate that I want a picture, followed maybe by its
  149. resource ID. When I call DrawText or TEUpdate I want to trap this special
  150. char by putting in a stdText bottleneck, load the picture and draw it, then
  151. make sure that the following text goes after the picture. Is this a
  152. feasible approach? Has anyone achieved anything like this using TextEdit-
  153. if so is there any sample code kicking about anywhere?
  154.  
  155. -Tanx a lot.
  156.  
  157. - ------------------------------------------------------------------------
  158. Love & BSWK, Graham
  159.  
  160. -Everyone is entitled to their opinion, no matter how wrong they may be...
  161. - ------------------------------------------------------------------------
  162.  
  163. +++++++++++++++++++++++++++
  164.  
  165. >From Philippe.Casgrain@univ-rennes1.fr (Philippe Casgrain)
  166. Date: Tue, 19 Apr 1994 17:29:20 +0100
  167. Organization: Universite de Rennes-1, Fac. de medecine dentaire
  168.  
  169. In article <u9119523-190494142034@case9.sys.uea.ac.uk>,
  170. u9119523@sys.uea.ac.uk (Graham Cox) wrote:
  171. > I want to embed a PICT in TextEdit automatically. The idea I have is to use
  172. > an obscure char to indicate that I want a picture, followed maybe by its
  173. > resource ID. When I call DrawText or TEUpdate I want to trap this special
  174. > char by putting in a stdText bottleneck, load the picture and draw it, then
  175. > make sure that the following text goes after the picture. Is this a
  176. > feasible approach? Has anyone achieved anything like this using TextEdit-
  177. > if so is there any sample code kicking about anywhere?
  178.  
  179.  That's almost exactly the way TeachText does it: when it sees an
  180. "option-space" in the text, it takes the first PICT resource it finds in
  181. the resource fork of the document and displays it, then resumes printing
  182. the text. When the next option-space comes along, TeachText displays the
  183. second PICT, and so on...
  184.  
  185.  So yes, i't been done before (TeachText uses TextEdit, how about
  186. SimpleText?), but I doubt the source to TeachText is available. There might
  187. be a snippet on ftp.apple.com, though.
  188.  
  189. Philippe
  190. -- 
  191. Philippe.Casgrain@univ-rennes1.fr, Mac Hacker Lite
  192.   Sirius Cybernetics Corporation
  193.  
  194. +++++++++++++++++++++++++++
  195.  
  196. >From thundero@news.delphi.com (THUNDERONE@DELPHI.COM)
  197. Date: 20 Apr 1994 04:19:51 -0000
  198. Organization: Delphi Internet Services Corporation
  199.  
  200. u9119523@sys.uea.ac.uk (Graham Cox) writes:
  201.  
  202. >I want to embed a PICT in TextEdit automatically. The idea I have is to use
  203. >an obscure char to indicate that I want a picture, followed maybe by its
  204. >resource ID. When I call DrawText or TEUpdate I want to trap this special
  205. >char by putting in a stdText bottleneck, load the picture and draw it, then
  206. >make sure that the following text goes after the picture. Is this a
  207. >feasible approach? Has anyone achieved anything like this using TextEdit-
  208. >if so is there any sample code kicking about anywhere?
  209.  
  210. Don't use stdText.  That's both overkill and unnecessarily complicating 
  211. things, and would also screw up hit-testing, if you could get it to 
  212. work.  What you want to do is p=TEGetPoint(offsetintotext), create a
  213. rectangle based on p, and draw the picture in that rectangle whenever you 
  214. call TEUpdate().
  215.  
  216. Chris
  217.  
  218. +++++++++++++++++++++++++++
  219.  
  220. >From oberst@gov.nt.ca (David Oberst)
  221. Date: Thu, 21 Apr 1994 00:00:40 GMT
  222. Organization: Government of the NWT, Canada
  223.  
  224. Re: earlier messages about including PICTs in a TextEdit, and "the source
  225. to TeachText" not being available.
  226.  
  227. True, but there is a shareware text editor out there called TexEdit (now
  228. in version 2.3.1, which now opens up TeachText files, including the pictures.
  229. The author offers to send the Pascal source via snail mail for $5 and a SASE.
  230. BBEdit is available in the Infomac archives (text directory, I think), and
  231. the author gives an email handle of     tombb@aol.com
  232.  
  233.     David Oberst/GNWT Bureau of Statistics/Yellowknife, NWT, Canada
  234.  
  235.  
  236. +++++++++++++++++++++++++++
  237.  
  238. >From markhanrek@aol.com (MarkHanrek)
  239. Date: 20 Apr 1994 16:59:02 -0400
  240. Organization: America Online, Inc. (1-800-827-6364)
  241.  
  242. >I want to embed a PICT in TextEdit automatically. The idea I have is to use
  243. >an obscure char to indicate that I want a picture, followed maybe by its
  244. >resource ID. When I call DrawText or TEUpdate I want to trap this special
  245. >char by putting in a stdText bottleneck, load the picture and draw it, then
  246. >make sure that the following text goes after the picture. Is this a
  247. >feasible approach? Has anyone achieved anything like this using TextEdit-
  248. >if so is there any sample code kicking about anywhere?
  249.  
  250. Locate a copy of "ShowHelp 2.0" which implements teachtext style text and
  251. graphics in a help window. There you will find the source code that does it,
  252. and also learn about a problem that has to do with updating, scrolling, nad the
  253. hilite color ( as I recall ).
  254.  
  255. I know "ShowHelp 2.0" is on AOL.
  256.  
  257. Mark Hanrek
  258.  
  259.  
  260. +++++++++++++++++++++++++++
  261.  
  262. >From dowdy@apple.com (Tom Dowdy)
  263. Date: Mon, 25 Apr 1994 19:31:05 GMT
  264. Organization: Apple Computer, Inc.
  265.  
  266. In article <Philippe.Casgrain-190494172920@193.49.46.4>,
  267. Philippe.Casgrain@univ-rennes1.fr (Philippe Casgrain) wrote:
  268.  
  269. >  That's almost exactly the way TeachText does it: when it sees an
  270. > "option-space" in the text, it takes the first PICT resource it finds in
  271. > the resource fork of the document and displays it, then resumes printing
  272. > the text. When the next option-space comes along, TeachText displays the
  273. > second PICT, and so on...
  274. >  So yes, i't been done before (TeachText uses TextEdit, how about
  275. > SimpleText?), but I doubt the source to TeachText is available. There might
  276. > be a snippet on ftp.apple.com, though.
  277.  
  278. SimpleText uses a similar mechanism, although it was slightly modified
  279. due to one basic problem with this approach -- it's not very international
  280. friendly.
  281.  
  282. TeachText/SimpleText use the non-breaking space character, which works
  283. well for the roman script system, but not for most double byte (and
  284. some other single-byte) script systems.  As a result, SimpleText has
  285. to have localization strings to allow for the use of other characters
  286. in these script systems -- but this means that documents aren't portable
  287. across various localized versions of SimpleText.
  288.  
  289. A better way is to key off of some other unused attribute (such
  290. as the color of the text) rather than the actual character content.
  291. However, this level of change couldn't be done for this version of
  292. SimpleText due to the need to be backwards compatible with documents
  293. from previous versions of TeachText.
  294.  
  295. I'd recommend that other folks store the PICT information separatly
  296. and not rely on the *content* of the strings for positioning information.
  297. In that way, you can read in the document on any localized version
  298. of your application and convert into the appropriate text-edit
  299. trick you wish to use -- but not actual store this hacked-up-data
  300. as part of your document format.
  301.  
  302. -- 
  303.  Tom Dowdy                  Internet: dowdy@apple.COM
  304.  Apple Computer MS:302-3KS  UUCP: {sun,voder,amdahl,decwrl}!apple!dowdy
  305.  1 Infinite Loop            AppleLink: DOWDY1
  306.  Cupertino, CA 95014       
  307.  "The 'Ooh-Ah' Bird is so called because it lays square eggs."
  308.  
  309. +++++++++++++++++++++++++++
  310.  
  311. >From walkerj@math.scarolina.edu (Jim Walker)
  312. Date: 19 Apr 1994 16:34:27 GMT
  313. Organization: University of South Carolina - Columbia - Computer Science
  314.  
  315.  
  316. The TeachText method is what I used in my Show_help code, available by ftp
  317. from bigbird.csd.scarolina.edu, pub/mac.
  318. --
  319.  
  320.  -- Jim Walker  USC Dept. of Math.  walkerj@math.scarolina.edu
  321.  
  322. ---------------------------
  323.  
  324. >From rblaine@tiac.net (Russ Blaine)
  325. Subject: How did YOU learn to program?
  326. Date: 18 Mar 1994 00:03:19 GMT
  327. Organization: The Internet Access Company
  328.  
  329. How did you learn to program? Did you take a class? Teach yourself 
  330. with a book? Become an apprentice, or what?
  331.  
  332. Just a general question directed to all members of the programming
  333. community, out of curiosity. I'm teaching myself (well, trying..)
  334. to program C using a book, its not too bad...
  335.  
  336. - ->Russ
  337. |----------------------------------------------------------------------|
  338. | rblaine@max.tiac.net                                                 |
  339. |----------------------------------------------------------------------|
  340. LAWYER: How did you happen to go to Dr. Cherney?
  341. WITNESS: Well, a gal down the road had had several of her children
  342.         by Dr. Cherney, and said he was really good.
  343.  
  344.  
  345. +++++++++++++++++++++++++++
  346.  
  347. >From greer@utdallas.edu (Dale M. Greer)
  348. Date: 18 Mar 1994 18:05:09 GMT
  349. Organization: The University of Texas at Dallas
  350.  
  351. Russ Blaine (rblaine@tiac.net) wrote:
  352. > How did you learn to program? Did you take a class? Teach yourself 
  353. > with a book? Become an apprentice, or what?
  354.  
  355. > Just a general question directed to all members of the programming
  356. > community, out of curiosity. I'm teaching myself (well, trying..)
  357. > to program C using a book, its not too bad...
  358.  
  359. I took one class in FORTRAN because it was required for physics
  360. majors.  This was just an introductory class, and I didn't really 
  361. learn much about real programming.  After that I just taught myself 
  362. the rest of FORTRAN, then BASIC, Z80 assembler, C, 8086 assembler,
  363. FORTH, 68000 assembler, C++, etc.
  364.  
  365. With FORTRAN, I learned from books and other people at the university.
  366. After that, learning the rest was fairly easy.  Programming is
  367. programming.
  368.  
  369. --
  370.  
  371. Dale Greer, greer@utdallas.edu
  372. "You can't just wake up and kiss the mirror and say 'I'm so purdy,
  373.  I think I'll run for Governor.'" - Texas Gov. Ann Richards
  374.  
  375.  
  376.  
  377. +++++++++++++++++++++++++++
  378.  
  379. >From markhanrek@aol.com (MarkHanrek)
  380. Date: 18 Mar 1994 13:14:02 -0500
  381. Organization: America Online, Inc. (1-800-827-6364)
  382.  
  383. It was simple.
  384.  
  385. I downloaded every cotton-pickin' piece of software that included C source code
  386. (C in my case) and compiled it.
  387.  
  388. The process of figuring out how that is done, and why these programs fail and
  389. learning to fix them, and why you know YOU don't want to write programs THAT
  390. way, :) is an excellent way to learn.
  391.  
  392. The important thing here is that you learn by performing an activity that is
  393. engaging, and is never overwhelming, and gives you a more frequent sense of
  394. gratification, because you will only be trying to make little improvements to a
  395. program here and there, and the next thing you know...
  396.  
  397. When one learns to program, one is usually learning TWO languages, the
  398. traditional language, like C or Pascal, and also the Mac Toolbox (by far more
  399. complex and potentially daunting).
  400.  
  401. Having fun, and maintaining interest, and SPENDING THE TIME IT TAKES, is
  402. essential to being able to reach a point of being "capable" -- roughly a
  403. man-year after you start ( though you can be instantly productive ).
  404.  
  405. Other than every piece of source code, get every bit of info, and access to as
  406. many resources as possible, and make friends with other programmers. Saving
  407. time is critical to success.
  408.  
  409. Have fun.
  410.  
  411. Mark Hanrek
  412.  
  413.  
  414. +++++++++++++++++++++++++++
  415.  
  416. >From Chuck Simciak <simciac@ccsmtp.ccf.org>
  417. Date: Fri, 18 Mar 1994 22:36:31 GMT
  418. Organization: Cleveland Clinic Foundation
  419.  
  420. In article <2mar47$78l@sundog.tiac.net> Russ Blaine, rblaine@tiac.net
  421. writes:
  422. >How did you learn to program? Did you take a class? Teach yourself 
  423. >with a book? Become an apprentice, or what?
  424. >
  425. >Just a general question directed to all members of the programming
  426. >community, out of curiosity. I'm teaching myself (well, trying..)
  427. >to program C using a book, its not too bad...
  428.  
  429. I started out by teaching myself AppleSoft (Basic) on an Apple 2+.  I
  430. tried to move on to Pascal but lost interest after a while.  Then for
  431. college I had to learn Pascal, and as I shifted over to a computer
  432. science major took classes which introduced me to C and Prolog, and a
  433. little bit of object oriented programming and 68000 assembly.  So far the
  434. most important things that I learned did not come from a  book.  "What
  435. makes up good programming Style?".  Such as using a format for naming
  436. variables, strategies for breaking down problems into reusable code
  437. segments, that sort of thing.
  438.  
  439. later....
  440.  
  441.     Chuck Simciak      !"The broken image of Man moves in minute by minute
  442.    wxs@po.cwru.edu     ! and cell by cell.... Poverty, hatred, war,
  443. police-
  444. simciac@ccsmtp.ccf.org ! criminals, bureaucracy, insanity, all symptoms of
  445. WRUW 91.1 FM Cleveland ! The Human Virus."           - William S.
  446. Burroughs
  447.  
  448. +++++++++++++++++++++++++++
  449.  
  450. >From kaufman@Xenon.Stanford.EDU (Marc T. Kaufman)
  451. Date: 19 Mar 1994 01:20:39 GMT
  452. Organization: Computer Science Department, Stanford University.
  453.  
  454. In article <2mar47$78l@sundog.tiac.net>, Russ Blaine <rblaine@tiac.net> wrote:
  455. >How did you learn to program? Did you take a class? Teach yourself 
  456. >with a book? Become an apprentice, or what?
  457.  
  458. I went over to the campus computer center.  The director said: "This is the
  459. manual, and that is the ON switch.  When you turn it off, let the drum cool
  460. down for at least 5 minutes before turning it on again.  Goodby."  That
  461. machine was a Royal-McBee LGP-30.  That's how it was done in those days.
  462. When the center got a new machine, you went out and got a new hardware
  463. manual.  Eventually you graduated to the Burroughs 220, the IBM 1401, the
  464. 709...
  465.  
  466. Marc Kaufman (kaufman@CS.Stanford.edu)
  467.  
  468.  
  469. +++++++++++++++++++++++++++
  470.  
  471. >From bsc@oui.com (Bill Stewart-Cole)
  472. Date: 18 Mar 1994 20:30:05 -0600
  473. Organization: Odyssey Ultraware Inc
  474. St Louis, MO
  475.  
  476. Russ Blaine asks:
  477.  
  478. > How did you learn to program? Did you take a class? Teach yourself
  479. > with a book? Become an apprentice, or what?
  480.  
  481. Here's a oddball story...
  482.  
  483.  
  484. In 8th grade Algebra our text included some BASIC. It wasn't covered in
  485. class, and in 1977-78 there was no computer in the school system outside from
  486. some IBM big iron at the central office chugging out grade info... But I read
  487. it and learned a little. 
  488.  
  489. In HS a few friends had Apples and commies, but my exposure was VERY limited.
  490. There was some oddball mini at school but as a quasi-jock I chose swimming
  491. and water polo over the computer club, and no coach in the USA would consider
  492. allowing one day per fortnight off prractice for some geek club...
  493.  
  494. In college I had a part-time job in the library, 82-84. My boss had taken a
  495. BASIC course and had written a little database running interpreted for
  496. managing the filling out of incomplete serial volumes. On a Honeywell DPS8. I
  497. read the BASIC docs at the Computer Center, lied about my abilities, compiled
  498. the thing and impressed her with the speed boost. I spent many months
  499. teaching myself BASIC and the timesharing OS (I want to say GCOS.... but my
  500. memory is chancy and imperfect) while refining the program. I proceeded to
  501. carelessly take advantage of sieve-like security so I had room to code and
  502. play in, and got bit by a malicious hacker... I was one of many rogues
  503. briefly blamed for a serious malicious crack.  Lost access, lost any hope of
  504. access there. got some time in as well on a TRS-80 running Xenix (no
  505. kidding...4 10Mb drives each the size of a AT case) 
  506.  
  507. Changed schools, changed majors, took a basic 'Systems and Data Processing'
  508. course that had some psuedo-assembly and pascal, plus was on a BITNET-linked
  509. machine (WOW!) and was VERY interested. Got a used commie and 300bps modem
  510. for it and worked from home(!) 
  511.  
  512. I was awed by the Mac. I saw it and my first thought was how silly my coding
  513. was compared to the guys who made this beastie run like this. but in 86 I got
  514. access to the one Plus at my new college, and bought a cheap copy of Turbo
  515. Pascal that I surreptitiously brought in and used. Coded some wierd stuff...
  516. Figured out Mac programming from the TP manual and bookstore sessions with
  517. IM. Taught myself the Pascal I had a taste of earlier along with the Mac
  518. coding paradigm. Hacked an interface to _Launch even though the IM1-4 docs on
  519. it were lousy, and TP ignored it. Coded a starchart plotter as an astronomy
  520. class project and got an A for the course even though the rest of my work was
  521. careless or missing. (lazy I am) 
  522.  
  523. After a year computerless after college, and 3 years doing unrelated work, I
  524. chucked a job I would never have been fired from mid-recession (91) and
  525. started coding and consulting for the Mac freelance. I took a Unix C course
  526. because I had to get a few hours of college CS anyway, and I haven't touched
  527. Pascal in over 18 months.  Maybe CodeWarrior will get me back to it... 
  528.  
  529. Basically I taught myself Pascal with a little VERY basic background and some
  530. self-taught BASIC. I picked up C very fast because of the Pascal background
  531. (C is Pascal abbreviated and without a net.... or at least more like Pascal
  532. than either is like the BASIC I learned)  You CAN teach yourself to program.
  533. On the Mac you really should have Inside Mac. Pascal is easier to teach
  534. yourself than C, because it will catch your goofs instead of letting you do
  535. stuff that is a little off (like treating a handle as a pointer... ) C++ (or
  536. and OOP system) is easy to learn if you know the base language and have an
  537. open minhd. It may even be easier to learn from scratch since you won't have
  538. to unlearn anything. 
  539.  
  540. +++++++++++++++++++++++++++
  541.  
  542. >From kenlong@netcom.com (Ken Long)
  543. Date: Mon, 21 Mar 1994 03:44:00 GMT
  544. Organization: NETCOM On-line Communication Services (408 241-9760 guest)
  545.  
  546. Learning how to program, and learning how to learn how = two separate things.
  547.  
  548. When I got my first computer that was current - a Mac 512 (wasn't even 
  549. all that current, but worked) - I was interested in learning to program 
  550. but had no idea how to start, and no one to ask about it.  I got no 
  551. manual with that Mac and learned the entire Mac interface by trial, error 
  552. and deductive reasoning.
  553.  
  554. I used to get disks of PD/SW from Best Bits and Bytes, in Van Nuys.  
  555. resEdit 1.2 was my favorite program.  I thought "Inside Mac DA" was some 
  556. sort of DA to tell you stuff about the internal workings of your Mac.
  557.  
  558. I bought Borland's Turbo Pascal for the Mac, but it assumed you knew how 
  559. to program - just wanted to change to Turbo.  I called Borland and said 
  560. they oughta say so on the box (bought at Egghead) and the "support" 
  561. person gave me a hard time.  I now use that disk for archive storage (not 
  562. S-7 compatible anyway).  I never knew Inside Mac even existed.
  563.  
  564. The next time I got into it was after 2 years of no Mac, and the purchase 
  565. of an LC.  By then I already had some IM volumes.  But it didn't take 
  566. very long to find out there was no established set of books or anything 
  567. to take a nonprogrammer to the point where he could at least write some 
  568. simple ones.  I don't mean copying code from a book and getting "talked 
  569. through it" - I mean learn enough to be able to create one on his own, 
  570. like you can with carpentry or other industrial arts, etc.
  571.  
  572. So, I figured the best way to learn to program was to get programs that 
  573. ran and see if I could find out what it was about them that made them 
  574. run.  What did they do, how did they do it, and when.  So I became a 
  575. source code junkie.
  576.  
  577. I'd trace a simple program in the debugger and if I didn't understand a 
  578. line I would look things up in IM from the line.  If it wasn't in IM, I'd 
  579. change something about the line - usually a value - and see what the 
  580. change did.  Then I'd change it back and try something else.
  581.  
  582. Also, I could recognise common aspects of various programs, and se 
  583. differences in them.  Recognizing differences, similarities and 
  584. identities, and eveluating relative importances is a key set of factors 
  585. to any learning process.  Comparing, examining, observing in operation, 
  586. commenting out, uncommenting, trying modifications, reading up on parts 
  587. of example source, and being able to locate a working example of any 
  588. routine or fragment of a program are all contibutors to the learning process.
  589.  
  590. What better source for the answer to a programming question than the 
  591. running output of a succesful programmer?.  What do I mean by successful 
  592. programmer?  One who wrote a program that runs.
  593.  
  594. Of course, I still have a long way to go to fill in all the gaps in my 
  595. learning.
  596.  
  597. Here's a tip, which I will not get into a position to implement:  Some 
  598. cracker-jack programmer, or group of programmers could make big bucks by 
  599. producing programming videos.  Sell them for $5.00 and have each one be 
  600. on one small subject - like one on regions, etc.  One on CDEFs, one on 
  601. pointers, one on setting up a menu bar from both code and resources.  Dig?
  602.  
  603. A guy buys all sorts of books on programming but just can't seem to get 
  604. "pointers."  He orders your tape on pointers, watches in on the TV next 
  605. to his Mac and finally gets them.  Why?  Because somebody SHOWED him, 
  606. intead of told him.  A potential gold mine, especially since the internet 
  607. is on it's way into the living room.
  608.  
  609. -Ken-
  610.  
  611. +++++++++++++++++++++++++++
  612.  
  613. >From rieck@peca.cs.umn.edu (Keith Rieck)
  614. Date: Mon, 21 Mar 1994 19:06:22 GMT
  615. Organization: Whatsamatta U, Mooselvania
  616.  
  617. In article <2mar47$78l@sundog.tiac.net>, rblaine@tiac.net (Russ Blaine) writes:
  618. |> How did you learn to program? Did you take a class? 
  619.  
  620. I was about 14 when Radio Shack came out with the TRS-80.  Our local store
  621. had a machine on display with the Basic manual sitting next to it.  I'd
  622. study the manual and play with the machine until the sales clerk threw 
  623. me out.  Then I'd come back later and do it again.
  624.  
  625. A lot of us are self-taught, but it's alarming how many people I know
  626. who have tried to start with C and have been blown away.  Typically, they 
  627. buy a top-of-the-line compiler and give up after reading the first 50 
  628. pages of their 500 page manual.  There are also plenty of otherwise 
  629. intelligent folks who enroll in introductory language classes, but never
  630. get beyond hello-world.
  631.  
  632. I haven't used Basic in years, but I still recommend it to anyone who's
  633. trying to learn programming.  It's got a very short learning curve and 
  634. they can start writing functioning programs in one afternoon.  
  635.  
  636. -- 
  637. /*   Keith Rieck   */int a[200],b=2,c,d=0,e;main(){for(;d<200;b++)for(c=0;;)
  638. {e=a[c++];if(c>d||e*e>b){a[d++]=b;printf("%5d\t",b);break;}if(b%e==0)break;}}
  639.  
  640. +++++++++++++++++++++++++++
  641.  
  642. >From chuck@gte.com (Chuck Hoffman)
  643. Date: Tue, 22 Mar 1994 15:00:50 GMT
  644. Organization: GTE Laboratories
  645.  
  646. In article <2mar47$78l@sundog.tiac.net> Russ Blaine, rblaine@tiac.net
  647. writes:
  648. >How did you learn to program? Did you take a class? Teach yourself 
  649. >with a book? Become an apprentice, or what?
  650. >
  651.  
  652. I learned FORTRAN in the Summer of 1965 at the U.S. Naval Academy.  Course
  653. name was "Weapons 707."
  654.  
  655. -- 
  656. Chuck Hoffman
  657. GTE Laboratories, Waltham, MA, USA
  658. 617-466-2131
  659. - ------------------------------------------------
  660. I'm not sure why we're here, but I am sure that
  661. while we're here we're supposed to help each other.
  662. - ------------------------------------------------
  663.  
  664. +++++++++++++++++++++++++++
  665.  
  666. >From jxd8856@hertz.njit.edu (Jennifer Deats)
  667. Date: 23 Mar 94 17:03:34 GMT
  668. Organization: New Jersey Institute of Technology, Newark, New Jersey
  669.  
  670. Way back in 1984, my parents got a 128K Mac (and it still works well...as long
  671. as the programs aren't expecting much in terms of hardware). At that point, 
  672. they decided to send me to National Computer Camp (NCC) in Connecticut. They 
  673. taught mostly on Apple IIs and a few TRS-80s. Basic, Pascal, and Assembly were 
  674. the languages they used. I learned an awful lot about some of the abilities of
  675. the Apple II, largely from other campers who did alot of "let's see what 
  676. happens when I do this".
  677.  
  678. I didn't touch programming too much for the next seven years. Then I went into
  679. computer science here and I'm stunned how fast Pascal came back to me. As for 
  680. other languages, some I learned through class, some I learned on my own, and
  681. alot I learned through experienced programmers who also attend school here.
  682.  
  683. Just my 2 cents.
  684.  
  685. -Jennifer
  686. -- 
  687. |   Jennifer Deats  |    This sig is    |
  688. |                   |  currently under  |
  689. |     CIS Major     |    constuction    |
  690.  
  691. +++++++++++++++++++++++++++
  692.  
  693. >From fixer@faxcsl.dcrt.nih.gov (Chris Gonna' Find Ray Charles Tate)
  694. Date: Wed, 23 Mar 1994 19:54:36 GMT
  695. Organization: DCRT, NIH, Bethesda, MD
  696.  
  697. How did I learn to program?
  698.  
  699. In 1981, my father purchased a *kit* for assembling a Sinclair ZX81 - the
  700. machine that later appeared under the Timex brand, as the Timex-Sinclair
  701. 1000.  It originally cost about $100 in kit form.
  702.  
  703. That little, tiny box had one of the best BASIC implementations I've
  704. ever used, packed into 8K of ROM.  It had a context-sensitive program
  705. editing mode (gave you 'GOTO' when you hit the 'G' key, etc.), and would
  706. syntax-check your program *as you typed it in*.  This was great for
  707. learning the syntax of BASIC (for a 12-year-old kid).
  708.  
  709. A bit later on, I started fiddling with assembly language on that same
  710. machine - it had a Zilog Z80 processor.  Nice machine, actually....  :-)
  711.  
  712. When I got to college, I had had enough experience with BASIC that my
  713. father and older brother assured me that I wouldn't have much problem
  714. learning FORTRAN, and so I jumped into the second-semester programming
  715. course, which was supposed to *finish* teaching its students Pascal and
  716. FORTRAN.  It was perfect - my first exposure to real data structures,
  717. challenging (to learn Pascal fast enough to handle the supposition that
  718. I already *knew* the syntax, etc.), and a good choice of projects.
  719.  
  720. The parts of it I remember were doing a single-source shortest-path
  721. algorithm (taught breadth-first search, basic graph representations, and
  722. queues) in Pascal, and a Choleski symmetric positive-definite matrix
  723. decomposition in FORTRAN, using a compacted matrix representation.  That
  724. one gave us a real feeling for what kinds of programming people who were
  725. serious about it did.
  726.  
  727. In retrospect, I think Pascal is a better first language than C or FORTRAN,
  728. since you have to deliberately avoid a lot of the 'sloppy' things that other
  729. languages let you get away with.  That makes for better coding style later
  730. on.
  731.  
  732. Penn State (my alma mater) also required a course in machine language,
  733. in which we studied machine representation of numbers (well, integers,
  734. and a *brief* exposure to some floating-point concepts - I didn't get
  735. any real floating-point exposure until I took a Math-department course
  736. in numerical methods), the basic operating principles of computers, and
  737. various architectures from a programmer's standpoint.  Specifically, we
  738. learned PDP-11 assembly language (the 'standard' stack-based machine, 
  739. with auto-increment and auto-decrement), as well as IBM 370 assembly
  740. language (the IBM mainframes are not stack-based).  No RISC, alas; I
  741. understand that not long after I took that course they started teaching
  742. MIPS assembly language and concepts rather than PDP-11.
  743.  
  744. The only other real 'learn to program' course wasn't exactly that; it was
  745. a class in abstract data types.  The text was Aho, Hopcroft, & Ullman;
  746. I think it might be taught with Corman, Leiserson, & Rivest these days.
  747. That's an important course - you need the knowledge of programming
  748. technique that comes with studying the art of data structure design and
  749. various programming approaches (dynamic programming, divide-and-conquer,
  750. greedy heuristics - all the standards you *should* know).
  751.  
  752. My senior year I took a course in OS design, with implementation in teams
  753. of three people.  It was a *ton* of work, but I'm glad I took it.  By
  754. that time I had been programming professionally (summer job at NIST) for
  755. several years, but hadn't don't anything of that scope.  It was a *fantastic*
  756. learning experience for dealing with a very large project, and for learning
  757. the ins and outs of a group project (code management, time management,
  758. et cetera).
  759.  
  760. I think the basic curriculum I had was quite good.  Penn State's CompSci
  761. department grew out of its Math department, rather than its Engineering
  762. school, and I think it shows (lots of theoretical study, not so much
  763. emphasis on digital engineering).  The course on formal language theory
  764. was ... work.  :-)
  765.  
  766. - --------------------------------------------------------------------------
  767. Christopher Tate            |  "I hate writing, and I hate statistics, but
  768. MSD, Inc.                   |   most of all I hate writing about statistics.
  769.                             |   I'd rather go to the dentist; at least there
  770. fixer@faxcsl.dcrt.nih.gov   |   you get to spit."     -- Ed Sewell
  771.  
  772. +++++++++++++++++++++++++++
  773.  
  774. >From zhfzc@zh014.ubs.ubs.ch (Christian Franz)
  775. Date: Thu, 24 Mar 1994 08:55:44 GMT
  776. Organization: Union Bank Switzerland, CH
  777.  
  778.  
  779. Well, in '78 me and my brother saved anough money to buy us an Apple II. 
  780. I began with Basic, then Applesoft Basic and then got the hang of 6502 Assembler.
  781. I remember having discussions with my brother about which programming language
  782. was better since he used the UCSD Pascal while I wrote 6502. I often ridiculed 
  783. him for his choice.
  784.  
  785. Well, I went on and implemented my own little language (called CFDS, I only know
  786. of a single other person who understands this language - hell, I was only 15 by
  787. then). 
  788.  
  789. Time went on and I finally went to university (ETH - Swiss Federal Institute
  790. of Technology, you know where Wirth hangs around). I got myself a Mac then and
  791. was immediately overwhelmed by the sheer complexity of the OS and the built-in
  792. routines, the guidelines you had to adhere to etc.
  793.  
  794. At ETH, I learned Modula-2 at first and then Oberon. Being an Assembly hacker, I
  795. had some difficulties with the concept of procedural, strongly-typed languages. It
  796. seemed all so clumsy while I could code the same problem in a very elegant 15-Byte
  797. tight loop...
  798. After about one year, my view started to shift. Suddenly I recognized the power
  799. of languages like Modula or their ancestor, Pascal. Plus, someone sold me her
  800. copy THINK Pascal. Now *that* was a development system that deserved its name.
  801.  
  802. After a while, I took a course in compiler design. Suddenly I *knew* why languages
  803. such as C or Assembler could never match the elegance and fitness for servicability
  804. that strongly-typed procedural languages have. And I have come to flushing when I
  805. remember how I laughed into my brother's face when he used the clumsy UCSD when
  806. he could have programmed assembler.
  807.  
  808. Nowadays I'm a fierce advocat of Pascal and Modula and have a strong dislike of
  809. C or the ultimate insult to cs engineers, C++ (flame bait, do not respond!).
  810. Of course I know there are times when you have to resort to extreme measures 
  811. (if you look at GrafSys, you'll notice that the ultra-fast Triangle routines are
  812. done in 68K assembler). But I like to forget that whenever possible.
  813.  
  814. Ok, to sum it up, I have learned to program the wrong way all by myself. The
  815. correct way I learned at the university. How to program on the Mac was a matter
  816. of Trial And Error at first. Then, after I had mastered most of the problems,
  817. I found this book 'Macintosh Programming Primer' which is IMHO one of the best
  818. of its kind and would have saved me about a year. Note that it is not intended
  819. for the beginner (in programming) but rather the experienced programmer who
  820. switches to the Mac. 
  821.  
  822.  
  823. Cheers,
  824. Christian
  825.  
  826. --
  827. Christian Franz                        *              Union Bank Of Switzerland
  828. cfranz@home.malg.imp.com         <- at home ->                     +1-261 26 96
  829.  
  830.  
  831. +++++++++++++++++++++++++++
  832.  
  833. >From jburke@UMASSD.EDU
  834. Date: Fri, 25 Mar 1994 16:27:22 GMT
  835. Organization: UMASS DARTMOUTH, NO. DARTMOUTH, MA.
  836.  
  837. In article <Cn13o9.50w@news.cis.umn.edu>, rieck@peca.cs.umn.edu (Keith Rieck) writes:
  838. >In article <2mar47$78l@sundog.tiac.net>, rblaine@tiac.net (Russ Blaine) writes:
  839. >|> How did you learn to program? Did you take a class? 
  840. >
  841. >I was about 14 when Radio Shack came out with the TRS-80.  Our local store
  842. >had a machine on display with the Basic manual sitting next to it.  I'd
  843. >study the manual and play with the machine until the sales clerk threw 
  844. >me out.  Then I'd come back later and do it again.
  845.  
  846. You mean someone else learned BASIC this way?  Yow.  They got so used to 
  847. kicking me out that they asked my mom if we were planning to move my
  848. bedroom furniture into the store.
  849.  
  850. - -----------------------------------------------------------------------------
  851. |James P. Burke       | This is some text that I like to put to the right of my|
  852. |Very Small Animal    | name because it makes this space look less empty.      |
  853. |JBURKE@umassd.edu    | Never put off 'till tomorrow saves nine. He who laughs |
  854. |DRMOMENTUM@aol.com   | last is worth two in the bush. "The foot is a game."   |
  855. - -----------------------------------------------------------------------------
  856.  
  857. +++++++++++++++++++++++++++
  858.  
  859. >From peirce@outpost.SF-Bay.org (Michael Peirce)
  860. Date: Sat, 26 Mar 94 14:44:42 PST
  861. Organization: Peirce Software, Inc.
  862.  
  863. In article <2mar47$78l@sundog.tiac.net>, Russ Blaine <rblaine@tiac.net> wrote:
  864. >How did you learn to program? Did you take a class? Teach yourself 
  865. >with a book? Become an apprentice, or what?
  866.  
  867. I learned FORTRAN out of a book.  I wrote a bowling scores program
  868. and finagled enough time on a old DEC RSTS system at the University
  869. of Toledo to type it in and debug it.  About the same time I spent some
  870. time at a summer NSF program at Indiana State and got to try my hand
  871. at punching cards for a IBM/360.
  872.  
  873. The next year my high school got its first Commodore PET and I learned
  874. BASIC (then taught the teachers BASIC).  I learned 6502 assembler
  875. on the machine too, plus 1802 assembler on an ELF that my physics
  876. teacher had bought.
  877.  
  878. During my freshman year at RPI I learned Pascal (by convincing them
  879. I knew enough FORTRAN to skip that).  It was the first year they tought
  880. Pascal instead of PL/I - thank goodness.  It was fun programming the
  881. big IBM/3033 - I think I was in the last class that really spent much
  882. time on the big mainframe.  By the time I graduated, the computer
  883. geaks (like me) had moved on to Unix workstations and PCs.  Ah IBM
  884. 370 assembler, a dying skill (at least I hope so).
  885.  
  886. I learned the Mac on a 512K with Megamax C (it was cool to see it
  887. use up screen memory when it had exhausted main memory - when the
  888. cool patterns filled up the screen, you knew you were hosed).  I learned
  889. C at the same time and grabbed as much sample code as I could and
  890. spent lots of hours reading the paper back version of Inside Mac.
  891.  
  892.  
  893. -- Michael Peirce        -- peirce@outpost.sf-bay.org
  894. -- Peirce Software, Inc. -- 719 Hibiscus Place, Suite 301
  895. --                       -- San Jose, California USA 95117
  896. -- Makers of: Smoothie & -- voice: +1.408.244.6554 fax: +1.408.244.6882
  897. --    Peirce Print Tools -- AppleLink: peirce & America Online: AFC Peirce
  898.  
  899. +++++++++++++++++++++++++++
  900.  
  901. >From dspman@aol.com (DSPman)
  902. Date: 27 Mar 1994 19:55:01 -0500
  903. Organization: America Online, Inc. (1-800-827-6364)
  904.  
  905. Get Marksman 3.0 by IT Makers.  It is a code generation tool.  You 
  906. lay out the user interface and it generates most of the code you 
  907. need that would take you a long time to write.
  908. Learning to program the Mac can be very difficult.  This program 
  909. got me over the hump by generating great skeleton code for a 
  910. program which I can study and ultimately understand.
  911.  
  912.  
  913. +++++++++++++++++++++++++++
  914.  
  915. >From dubois@primate.wisc.edu (Paul DuBois)
  916. Date: 27 Mar 1994 21:14:07 -0600
  917. Organization: Castra Parvulorum
  918.  
  919.  
  920. >How did YOU learn to program?
  921.  
  922. Still haven't.
  923. -- 
  924. Paul DuBois
  925. dubois@primate.wisc.edu
  926.  
  927. +++++++++++++++++++++++++++
  928.  
  929. >From me362@lu.erisoft.se (Mats Ekberg)
  930. Date: Wed, 6 Apr 1994 13:49:21 GMT
  931. Organization: Erisoft AB, Sweden
  932.  
  933.  
  934. In article b4o@search01.news.aol.com, dspman@aol.com (DSPman) writes:
  935. []Get Marksman 3.0 by IT Makers.  It is a code generation tool.  You 
  936. []lay out the user interface and it generates most of the code you 
  937. []need that would take you a long time to write.
  938. []Learning to program the Mac can be very difficult.  This program 
  939. []got me over the hump by generating great skeleton code for a 
  940. []program which I can study and ultimately understand.
  941. []
  942.  
  943. But that results in "regular" procedural programming.
  944. Isn't it better to try to go object-oriented?
  945.  
  946. What is the experience of all You programmers, what are the major
  947. differences between procedural and OO programming on the Mac?
  948. Tools, code-size, speed, complexity, serviceability and so on...
  949.  
  950.  
  951. [----------------------------------------------------------------------]
  952. | Addr:  Mats Ekberg @ Erisoft AB  | Voice: +46 920-427 00             |
  953. |        Box 920                   | Email: Mats.Ekberg@lu.erisoft.se  |
  954. |        S-951 28  LULEA           | Memo:  ERI.ECOM.EPLMEK            |
  955. [----------------------------------------------------------------------]
  956.  
  957.  
  958.  
  959. +++++++++++++++++++++++++++
  960.  
  961. >From deeny3@aol.com (Deeny3)
  962. Date: 9 Apr 1994 23:16:04 -0400
  963. Organization: America Online, Inc. (1-800-827-6364)
  964.  
  965. Nineteen years ago, I was working for my father, a consulting physicist. He had
  966. a lot of programming he needed done (stuff that you could do in Excel now, of
  967. course), and so he suggested that I take a class. I did -- and it's the only
  968. one I ever took. Most of what I learned I learned at home or on the job. I've
  969. programmed all my adult life and will continue to do so.
  970.  
  971. _Deirdre
  972.  
  973. In article <2mar47$78l@sundog.tiac.net>, rblaine@tiac.net (Russ Blaine) writes:
  974.  
  975. >>How did you learn to program? Did you take a class? Teach yourself 
  976. with a book? Become an apprentice, or what?
  977.  
  978. Just a general question directed to all members of the programming
  979. community, out of curiosity. I'm teaching myself (well, trying..)
  980. to program C using a book, its not too bad...<<
  981.  
  982.  
  983. +++++++++++++++++++++++++++
  984.  
  985. >From bas2631@silver.sdsmt.edu (Brian Stone)
  986. Date: 11 Apr 1994 20:25:14 GMT
  987. Organization: South Dakota School of Mines and Technology
  988.  
  989. Deeny3 (deeny3@aol.com) wrote:
  990. : Nineteen years ago, I was working for my father, a consulting physicist. He had
  991. : a lot of programming he needed done (stuff that you could do in Excel now, of
  992. : course), and so he suggested that I take a class. I did -- and it's the only
  993. : one I ever took. Most of what I learned I learned at home or on the job. I've
  994. : programmed all my adult life and will continue to do so.
  995.  
  996. : _Deirdre
  997.  
  998. : In article <2mar47$78l@sundog.tiac.net>, rblaine@tiac.net (Russ Blaine) writes:
  999.  
  1000. : >>How did you learn to program? Did you take a class? Teach yourself 
  1001. : with a book? Become an apprentice, or what?
  1002.  
  1003. : Just a general question directed to all members of the programming
  1004. : community, out of curiosity. I'm teaching myself (well, trying..)
  1005. : to program C using a book, its not too bad...<<
  1006.  
  1007.  
  1008.  
  1009.     Im following up on this just cause Im bored at the moment...
  1010.     
  1011.     I taught my self Basic on the Commodor 64 when I was 12.  I wrote
  1012. a few programs... nothing fancy.  Just messed around with sprites and
  1013. little animations.  My father saw that I was interested in this and 
  1014. gave me his 64, while he was given a Lisa computer to do some consulting
  1015. business.  I was somewhat fasinated by this computer although I never
  1016. did any programing on it.  When the Mac Plus came out, my father bought
  1017. one.  I imediatly started playing around with it, I must have been 16
  1018. at the time.  When he bought Microsoft Q-Basic, that became my buddy
  1019. for the years to come.  I taught my self the inner workings of Q-basic
  1020. and started writting quite a few small games and other programs.  When
  1021. I was a Junior in highschool I took my first Pascal course.  However, 
  1022. I never programed much in Pascal outside the class room.  I took two
  1023. years of Pascal, both in my Junior and Senior years.  I began college
  1024. as a traditional student, just after highschool.  In my first year I 
  1025. took a FORTRAN course... probably more usless than Pascal.  In the
  1026. first semester of my second year I took an Ansi C course.  After that
  1027. course, I taught my self C++.  Since then, however, I havnt used 
  1028. C much at all.  Im mainly a Basic programer... but Im slowly trying
  1029. to relearn C++.  I got a book on programing 3D graphics in C.  About
  1030. six months ago, I translated it into Q-Basic, and it works pretty good.
  1031. But, Q-basic is slow... too slow, and I need speed.  In fact, C is also
  1032. too slow for what I need, so part of my problem is porting certain
  1033. functions to Assembly code.  At the moment I am taking an Assembly
  1034. programing class for 386 processors, and I hope to use that knowlege
  1035. to help me write Assembly programs for the 6800x0 Motorola processors.
  1036. Eventualy I will use my knowlege of 3D graphics, Assembly, and C++
  1037. to write my biggest game yet.  Hopfully a 3D Space battle game, not
  1038. unlike X-Wing for PC's.  Ive already used 3D graphics in an Artillary
  1039. style game that I wrote in Q-Basic... but like I said before... its way
  1040. too slow.   I have not yet compleated the program, and the game dosnt
  1041. have any sound to it, so I probably will never release this game.  But
  1042. I hope to have my 3D space battle game out by the end of the year...
  1043. depending on if my sanity holds.  
  1044.                 
  1045.  
  1046.     From the man on a mission from God... and Mars,
  1047.         Brian "the man with a head of lettuce" Stone
  1048.         bas2631@silver.sdsmt.edu
  1049.  
  1050.  
  1051.  
  1052.  
  1053. +++++++++++++++++++++++++++
  1054.  
  1055. >From dvorak@extro.ucc.su.OZ.AU (Darko Volaric)
  1056. Date: Sat, 9 Apr 1994 03:53:00 GMT
  1057. Organization: /etc/organization
  1058.  
  1059. In article <Cn8B1o.J8J@umassd.edu> jburke@UMASSD.EDU writes:
  1060. >In article <Cn13o9.50w@news.cis.umn.edu>, rieck@peca.cs.umn.edu (Keith Rieck) writes:
  1061. >>In article <2mar47$78l@sundog.tiac.net>, rblaine@tiac.net (Russ Blaine) writes:
  1062. >>|> How did you learn to program? Did you take a class? 
  1063. >>
  1064. >>I was about 14 when Radio Shack came out with the TRS-80.  Our local store
  1065. >>had a machine on display with the Basic manual sitting next to it.  I'd
  1066. >>study the manual and play with the machine until the sales clerk threw 
  1067. >>me out.  Then I'd come back later and do it again.
  1068. >
  1069. >You mean someone else learned BASIC this way?  Yow.  They got so used to 
  1070. >kicking me out that they asked my mom if we were planning to move my
  1071. >bedroom furniture into the store.
  1072. >
  1073. I did the same thing (but when I was about 10) but they let me stay since I'd
  1074. tell the customers what I was doing and what the computer could do. I probably
  1075. was responsible for more sales than the (rather ignorant) salesperson.
  1076.  
  1077.  
  1078.  
  1079. +++++++++++++++++++++++++++
  1080.  
  1081. >From jjensen@kaiwan.com (John Jensen)
  1082. Date: 20 Apr 1994 05:24:46 -0700
  1083. Organization: KAIWAN Internet (310/527-4279,818/756-0180,714/741-2920)
  1084.  
  1085. Darko Volaric (dvorak@extro.ucc.su.OZ.AU) wrote:
  1086. : In article <Cn8B1o.J8J@umassd.edu> jburke@UMASSD.EDU writes:
  1087. : >In article <Cn13o9.50w@news.cis.umn.edu>, rieck@peca.cs.umn.edu (Keith Rieck) writes:
  1088. : >>In article <2mar47$78l@sundog.tiac.net>, rblaine@tiac.net (Russ Blaine) writes:
  1089. : >>|> How did you learn to program? Did you take a class? 
  1090. : >>
  1091. : >>I was about 14 when Radio Shack came out with the TRS-80.  Our local store
  1092. : >>had a machine on display with the Basic manual sitting next to it.  I'd
  1093. : >>study the manual and play with the machine until the sales clerk threw 
  1094. : >>me out.  Then I'd come back later and do it again.
  1095. : >
  1096. : >You mean someone else learned BASIC this way?  Yow.  They got so used to 
  1097. : >kicking me out that they asked my mom if we were planning to move my
  1098. : >bedroom furniture into the store.
  1099. : >
  1100. : I did the same thing (but when I was about 10) but they let me stay since I'd
  1101. : tell the customers what I was doing and what the computer could do. I probably
  1102. : was responsible for more sales than the (rather ignorant) salesperson.
  1103.  
  1104. Me too.  I had just finished a Fortran course at school (I was studying 
  1105. chemistry).  I walked into a Radio Shack and looked at the BASIC manual 
  1106. for the TRS-80.  It was a learn-as-you-go thing, so I just started 
  1107. typing.  No one ever bothered me, and I walked out a couple hours later 
  1108. knowing BASIC.
  1109.  
  1110. Thank you Radio Shack.
  1111.  
  1112. John
  1113.  
  1114. +++++++++++++++++++++++++++
  1115.  
  1116. >From gdl@danube.maths (Greg Landweber)
  1117. Date: 21 Apr 1994 17:04:58 GMT
  1118. Organization: (none)
  1119.  
  1120. In article <Cnz44C.527@ucc.su.OZ.AU> dvorak@extro.ucc.su.OZ.AU (Darko Volaric) writes:
  1121.    >>I was about 14 when Radio Shack came out with the TRS-80.  Our local store
  1122.    >>had a machine on display with the Basic manual sitting next to it.  I'd
  1123.    >>study the manual and play with the machine until the sales clerk threw 
  1124.    >>me out.  Then I'd come back later and do it again.
  1125.  
  1126. My school got a TRS-80 when I was 10, and I used to stay after school
  1127. to play on it.  I remember at one point it told me to "type mismatch".
  1128. Then, when I typed "mismatch", it said "syntax error".
  1129.  
  1130. The following year, my school got an Apple ][+, I learned Logo, and
  1131. convinced my parents to get me an Apple //e.  I learned Pascal the
  1132. following summer and took a data structures and algorithms class the
  1133. summer after that.  In high school, I wrote a grade book (jointly with
  1134. Dean Yu) and a class rank program for the teachers and administrators
  1135. in AppleSoft basic, and I fiddled a lot with Turbo Pascal (writing
  1136. painfully slow interpreters for Lisp and Logo, and a Star Trek battle
  1137. simulation based on a board game).
  1138.  
  1139. I was declared prophet by my A.P.Computers class, which decided to
  1140. start its own religion.  We waited for the second coming of the Timex
  1141. Sinclair, while taking our frustrations out on an empty husk of a
  1142. Franklin Ace (which came on a cart with boxing gloves).
  1143.  
  1144. I got a Mac when I went to college, and the rest is history.
  1145.  
  1146. BTW, I learned C somewhere over the Atlantic Ocean.  I brought K&R
  1147. with me to read on a flight to England.  I read it again on the way
  1148. back, and I started programming in C when I got home.
  1149.  
  1150. -- Greg "Buttons" Landweber
  1151.    gdl@maths.ox.ac.uk
  1152.  
  1153. +++++++++++++++++++++++++++
  1154.  
  1155. >From bootstrap1@aol.com (Bootstrap1)
  1156. Date: 20 Apr 1994 23:45:07 -0400
  1157. Organization: America Online, Inc. (1-800-827-6364)
  1158.  
  1159. I had watched a friend write a few little, ten-line BASIC programs making a dot
  1160. bounce around on screen on the TRS-80 locked in the back of one of the
  1161. classrooms.  The next year, while studying Trig, I asked my teacher if I could
  1162. try to program it to draw a circle.  With no manual, and only the experience of
  1163. watching my friend, I wrote the following program.
  1164.  
  1165. 10 X = 0
  1166. 20 X * X + Y * Y = 100
  1167. 30 PLOT X,Y
  1168. 40 X = X + 1
  1169. 50 GOTO 20
  1170.  
  1171. Needless to say, it wouldn't run.  The next week she let me go to the computer
  1172. lab, where they had manuals, during class.  Within a couple of days I had the
  1173. program running, learned the fundamentals just browsing through the manual,
  1174. battled the notorious TRS-80 Mod 1 tape drive, then didn't write another line
  1175. of code for three months.  At Christmas my Dad bought an Apple II+ for our
  1176. family (this was '81) and I spent 60 hours coding the first three days we had
  1177. it.  Six months later I was interning at a startup, writing (not very good)
  1178. commercial software for the new IBM PC.
  1179.  
  1180. Nathan Tennies
  1181. Bootstrap Enterprises Inc
  1182.  
  1183. ---------------------------
  1184.  
  1185. >From jscho@soda.berkeley.edu (John S. Cho)
  1186. Subject: How do I get machine-user name?
  1187. Date: Sun, 03 Apr 1994 16:23:48 -0800
  1188. Organization: University of California, Berkeley
  1189.  
  1190. I need some help obtaining the machine and user names from the Shared Setup
  1191. control panel. I've played around with the PBxxxx routines and the PPC
  1192. toolbox but got no where. Anyhelp would be much appreciated.
  1193.  
  1194. John
  1195.  
  1196.  
  1197.        ._/                      --=o0o=--    .
  1198.       ._/  John Seungwon Cho                ( "If not today, nor yet
  1199.  ._/ ._/  University of California, Berkeley `. tomorrow, then some other
  1200. ._/_/_/  jscho@{soda,uclink,ocf}.berkeley.edu  )  day."    - Dream Theater
  1201.  
  1202. +++++++++++++++++++++++++++
  1203.  
  1204. >From jumplong@aol.com (Jump Long)
  1205. Date: 5 Apr 1994 00:04:01 -0400
  1206. Organization: America Online, Inc. (1-800-827-6364)
  1207.  
  1208. In article <jscho-030494162348@sultan.hip.berkeley.edu>,
  1209. jscho@soda.berkeley.edu (John S. Cho) writes:
  1210.  
  1211. > I need some help obtaining the machine and user names from the Shared Setup
  1212. > control panel. I've played around with the PBxxxx routines and the PPC
  1213. > toolbox but got no where. Anyhelp would be much appreciated.
  1214.  
  1215. You can get those names from system resources -16096 (user name) and -16413
  1216. (computer name) using the GetString function.  As noted in the Technical Note
  1217. "AppleTalk, the Rest of the Story":
  1218.  
  1219. "System software version 7.0 allows the user to enter a personalized name by
  1220. which her system will be published when connected to an AppleTalk network. The
  1221. System 'STR ' resource ID -16413 is used to hold this name. The name (listed as
  1222. Macintosh Name) can be up to 31 characters in length and can be set using the
  1223. Sharing Setup Control Panel Device (cdev). This resource is different from the
  1224. Chooser name, System 'STR ' resource ID -16096. When providing network services
  1225. for a workstation, the Flagship name should be used so that the user can
  1226. personalize his workstation name while maintaining the use of the Chooser name
  1227. for server connection identification. It's important to note that the Flagship
  1228. name resource is available only from system software version 7.0. DTS
  1229. recommends that applications not change either of these 'STR ' resources."
  1230.  
  1231. - Jim Luther
  1232.  
  1233.  
  1234. +++++++++++++++++++++++++++
  1235.  
  1236. >From jeff31415@aol.com (Jeff 31415)
  1237. Date: 19 Apr 1994 18:07:02 -0400
  1238. Organization: America Online, Inc. (1-800-827-6364)
  1239.  
  1240. In article <jscho-030494162348@sultan.hip.berkeley.edu>,
  1241. jscho@soda.berkeley.edu (John S. Cho) writes:
  1242.  
  1243. > I need some help obtaining the machine and user names from the Shared Setup
  1244. > control panel. I've played around with the PBxxxx routines and the PPC
  1245. > toolbox but got no where. Anyhelp would be much appreciated.
  1246.  
  1247. I don't know if this is a recommended way to do it, but I find that grabbing
  1248. the
  1249. appropriate STR# from the active system file works just fine (under System 7).
  1250. I haven't seen anything documented by Apple on this one.
  1251.  
  1252. Sorry, I can't find the code write now. Email me if you want me to search for
  1253. it in a more serious way.
  1254.  
  1255. -Jeff Abrahamson
  1256.  
  1257.  
  1258.  
  1259. +++++++++++++++++++++++++++
  1260.  
  1261. >From jwbaxter@olympus.net (John W. Baxter)
  1262. Date: Wed, 20 Apr 1994 08:17:36 -0700
  1263. Organization: Internet for the Olympic Peninsula
  1264.  
  1265. In article <2p1km6$rve@search01.news.aol.com>, jeff31415@aol.com (Jeff
  1266. 31415) wrote:
  1267.  
  1268. > In article <jscho-030494162348@sultan.hip.berkeley.edu>,
  1269. > jscho@soda.berkeley.edu (John S. Cho) writes:
  1270. > > I need some help obtaining the machine and user names from the Shared Setup
  1271. > > control panel. I've played around with the PBxxxx routines and the PPC
  1272. > > toolbox but got no where. Anyhelp would be much appreciated.
  1273. > I don't know if this is a recommended way to do it, but I find that grabbing
  1274. > the
  1275. > appropriate STR# from the active system file works just fine (under System 7).
  1276. > I haven't seen anything documented by Apple on this one.
  1277.  
  1278. Per Inside Mac: More Mac Toolbox, page 1-127--
  1279.  
  1280. User name is 'STR ' -16096
  1281. Computer name is 'STR ' -16413
  1282.  
  1283. I don't remember how far back into pre-history the above is true [by my
  1284. definition, System 6 is pre-history...others--correctly for their
  1285. purposes--disagree].
  1286.  
  1287. -- 
  1288. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  1289.    jwbaxter@pt.olympus.net
  1290.  
  1291. ---------------------------
  1292.  
  1293. >From egurney@vcd.hp.com (Eddy J. Gurney)
  1294. Subject: How to: Aladdin-aware ResEdit (was Re: ResEdit + dctb = ID=01?)
  1295. Date: Tue, 19 Apr 1994 20:54:52 GMT
  1296. Organization: Hewlett-Packard VCD
  1297.  
  1298. Rich Siegel (siegel@netcom.com) wrote:
  1299. >In article <sobiloff-180494111601@bsospsyc151.umd.edu> sobiloff@lap.umd.edu writes:
  1300. >>This happens when I try to look at StuffIt Expander 3.0.7 or BBEdit
  1301. >>2.3.2 (I can open a single resource with BBEdit, but then crash if I
  1302. >>try to open another one).
  1303.  
  1304. >Out of coincidence, the two applications you tried both contain
  1305. >compressed resources. (They're compressed by a scheme that ResEdit
  1306. >doesn't know.) Try other examples, such as your copy of THINK C, or
  1307. >MPW, or whatever...
  1308.  
  1309. Or, make ResEdit aware of the Aladdin resource compression scheme.
  1310.  
  1311. Below are my instructions on installing the Aladdin resource
  1312. decompressor (found in the FreeWare "BBEdit Lite", which you will
  1313. need a copy of) into a fresh ResEdit 2.1.1. NOTE: I take absolutely
  1314. no responsibility for this patch; I was bored one weekend and decided
  1315. to see if I could get this to work. I feel I was successful; however,
  1316. I don't feel comfortable that the Aladdin resource decompressor is
  1317. properly "deinstalled" when you quit ResEdit. I'm not sure what effect
  1318. this has; everything SEEMS to work fine. The problem with ResEdit 2.1.1
  1319. is that it *already* adds a resource decompressor (the Apple one) when
  1320. you launch ResEdit. I intercept that patch, add the Aladdin version,
  1321. and then continue on and add the Apple version. FYI, they are patching
  1322. an undocumented (as far as I know!) trap, _A0FC, to implement resource
  1323. decompression. It looked like the Apple scheme does a tail patch on
  1324. that trap, so both decompressors work together. But I don't think the
  1325. Aladdin de-installer is ever called, since ResEdit probably just calls
  1326. _ExitToShell somewhere. SO... after you've used your "special" version
  1327. of ResEdit, you may want to restart.
  1328.  
  1329. THINK Reference also installs its own resource decompressor (you can
  1330. see the code patching _A0FC as well).  However it is different from
  1331. the Aladdin or Apple version... 
  1332.  
  1333. Patching ResEdit 2.1.1 to use the Aladdin Resource Decompressor
  1334. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1335.  
  1336. What you will need:
  1337. A fresh (ie, non-patched) copy of ResEdit, version 2.1.1
  1338. A fresh (ie, non-patched) copy of the freeware BBEdit Lite, version 2.3.2
  1339. Experience using ResEdit to patch stuff. :-)
  1340.  
  1341.  1. Make a copy of ResEdit from the Finder. When we're done, this copy will
  1342.     have the Aladdin resource decompressor automagically installed when you
  1343.     launch this copy.
  1344.  2. Open the new copy of ResEdit in ResEdit. Whoa, like weird, man. :-)
  1345.  3. Open BBEdit Lite 2.3.2 in ResEdit
  1346.  4. (Optional). Double-click on the 'sicn' resource in BBEdit Lite and 
  1347.     notice that 'sicn' 911 is "messed up" (because its compressed).  Don't
  1348.     open any DLOG's or anything, or ResEdit will CRASH!
  1349.  5. Click once on the "DCMP" resource in the BBEdit Lite window and choose
  1350.     "Copy".
  1351.  6. Select the ResEdit window and choose "Paste".
  1352.  7. Double-click on the CODE resource icon in the BBEdit Lite window. Select
  1353.     CODE resource 1, and choose "Open Using Hex Editor" from the "Resource"
  1354.     menu.
  1355.  8. Go to offset 0x005638 (very close to the end, should start with 4E71
  1356.     42A7 6100...) and drag select to the end of the resource (offset 0x0058FB,
  1357.     should end with A198 4ED1). Make sure you are selecting the hex numbers
  1358.     and NOT the ASCII representation on the right.
  1359.  9. Choose "Copy".
  1360. 10. Close all the windows associated with BBEdit Lite, we're done with them.
  1361. 11. Double-click on the CODE resource icon in the ResEdit window.  Select CODE
  1362.     resource 66, and choose "Open Using Hex Editor" from the "Resource"
  1363.     menu.
  1364. 12. Go to the end of the resource (should end with 11C7 0A5E 4E75) and click
  1365.     after the 4E75.
  1366. 13. Choose "Paste".
  1367. 14. Move to offset 0x0005EC (this is in the newly pasted section, should
  1368.     start with FE9C 6100 0114) and select the "FE9C" bytes and change them
  1369.     to "FA24".
  1370. 15. Close the CODE ID=66 hex editor window.
  1371. 16. Select CODE resource 0 (the jump table) and choose "Open Using Hex Editor"
  1372.     from the "Resource" menu.
  1373. 17. Move to offset 0x000010 (should start with 000C 3F3C 0042...) and select
  1374.     the "000C" bytes and change them to "05DA".
  1375. 18. Select "Save" from the File menu.
  1376. 18. Select "Get Info for <filename>" from the File menu and change the
  1377.     modification date (the "Modified:" field) to something *older* than
  1378.     the copy of ResEdit you want to run when you double-click on a
  1379.     ResEdit document.  Close the dialog and save the changes.  Why do you
  1380.     need to do this?  Since you now have two copies of ResEdit on your
  1381.     system, the Finder will launch the latest-modified version (which is
  1382.     your newly patched version). Since you will normally want to run the
  1383.     "non modified" version, just make the patched version older.
  1384. 19. Quit out of ResEdit. The patch is complete and ready to go.  I have not
  1385.     noticed any side effects from making this patch, but that DOESN'T mean
  1386.     there aren't any!  At least you can view/edit/change Aladdin-compressed
  1387.     resources now.  NOTE: changing a compressed resource and saving the
  1388.     changes will save it in an uncompressed state!  The Aladdin decompressor
  1389.     does NOT warn you that the resource you're opening is compressed like
  1390.     the Apple decompressor does.
  1391. 20. (Optional) Launch your newly modified ResEdit.  Open BBEdit Lite again,
  1392.     and verify that 'sicn' 911 is no longer "messed up".  Cool. :-)
  1393.  
  1394. --
  1395. Eddy J. Gurney N8FPW   Hewlett-Packard Company, Vancouver (USA!) Division
  1396. egurney@vcd.hp.com                       #include <standard-disclaimer.h>
  1397. "Failures are divided into two classes-- those who thought and never did,
  1398.       and those who did and never thought."     John Charles Salak
  1399.  
  1400. +++++++++++++++++++++++++++
  1401.  
  1402. >From leonardr@netcom.com (Leonard Rosenthol)
  1403. Date: Wed, 20 Apr 1994 17:26:32 GMT
  1404. Organization: Aladdin Systems, Inc.
  1405.  
  1406. In article <CoIy3H.JAo@vcd.hp.com>, egurney@vcd.hp.com (Eddy J. Gurney) wrote:
  1407.  
  1408. > Or, make ResEdit aware of the Aladdin resource compression scheme.
  1409. > Below are my instructions on installing the Aladdin resource
  1410. > decompressor 
  1411. > [details removed]
  1412. >
  1413.    Just a reminder to folks that if you must do this, you can NO LONGER
  1414. distribute that copy of ResEdit as you have now added "Aladdin
  1415. Copyrighted" material that is NOT yours to redistribute.  As our box says
  1416. "Our Lawyers are Happy",  please keep them that way ;).
  1417.  
  1418.    On a related note, are there REALLY a lot of you who would like to be
  1419. able to modify our compressed resources?  Feel free to EMail me and let me
  1420. know if there are - maybe we can help...
  1421.  
  1422.  
  1423. Leonard
  1424. - ------------------------------------------------------------------------
  1425. Leonard Rosenthol                      Internet:       leonardr@netcom.com
  1426. Director of Advanced Technology        AppleLink:      MACgician
  1427. Aladdin Systems, Inc.                  GEnie:          MACgician
  1428.  
  1429. ---------------------------
  1430.  
  1431. >From rrose@CSOS.ORST.EDU (-= Godfather Moof =-)
  1432. Subject: Window -> PICT question
  1433. Date: 13 Apr 1994 14:29:26 GMT
  1434. Organization: CS Outreach Services, Oregon State University, Corvallis, OR, USA
  1435.  
  1436. Any people out in the cloud know how to convert a window to a PicHandle?
  1437.  
  1438. I've got a 256x256 window that I want to use as a pict...
  1439.  
  1440. Thanks.  Please reply to rrose@csos.orst.edu.
  1441.  
  1442. +++++++++++++++++++++++++++
  1443.  
  1444. >From u9119523@sys.uea.ac.uk (Graham Cox)
  1445. Date: Thu, 14 Apr 1994 11:23:31 GMT
  1446. Organization: School of Information Systems, UEA, Norwich
  1447.  
  1448. In article <2ogvk6$4k4@jadzia.CSOS.ORST.EDU>, rrose@CSOS.ORST.EDU (-=
  1449. Godfather Moof =-) wrote:
  1450.  
  1451. > Any people out in the cloud know how to convert a window to a PicHandle?
  1452. > I've got a 256x256 window that I want to use as a pict...
  1453. > Thanks.  Please reply to rrose@csos.orst.edu.
  1454.  
  1455.  
  1456. Try this:
  1457.  
  1458.  
  1459. PicHandle MakeWindowPict(WindowPtr theWindow)
  1460. {
  1461.  
  1462.     Rect        r;
  1463.     PicHandle    p;
  1464.  
  1465.  
  1466.  
  1467.     GetPort(&originalPort);
  1468.     SetPort(theWindow);
  1469.     r = thePort->portRect;
  1470.     p = OpenPicture(&r);
  1471.     CopyBits(&thePort->portBits,&thePort->portBits,&r,&r,srcCopy,NULL);
  1472.     ClosePicture();
  1473.     SetPort(originalPort);
  1474.     return(p);
  1475. }
  1476.  
  1477.  
  1478. Off the top of my head so check the function calls in case I remembered
  1479. them wrong.
  1480.  
  1481. - ------------------------------------------------------------------------
  1482. Love & BSWK, Graham
  1483.  
  1484. -Everyone is entitled to their opinion, no matter how wrong they may be...
  1485. - ------------------------------------------------------------------------
  1486.  
  1487. +++++++++++++++++++++++++++
  1488.  
  1489. >From jdm@newton (James D. Meiss)
  1490. Date: 17 Apr 1994 17:23:22 GMT
  1491. Organization: University of Colorado, Boulder
  1492.  
  1493. In article <u9119523-140494112331@case10.sys.uea.ac.uk> u9119523@sys.uea.ac.uk (Graham Cox) writes:
  1494. >
  1495. >
  1496. >PicHandle MakeWindowPict(WindowPtr theWindow)
  1497. >{
  1498. >
  1499. >    Rect        r;
  1500. >    PicHandle    p;
  1501. >
  1502. >
  1503. >
  1504. >    GetPort(&originalPort);
  1505. >    SetPort(theWindow);
  1506. >    r = thePort->portRect;
  1507. >    p = OpenPicture(&r);
  1508. >    CopyBits(&thePort->portBits,&thePort->portBits,&r,&r,srcCopy,NULL);
  1509. >    ClosePicture();
  1510. >    SetPort(originalPort);
  1511. >    return(p);
  1512. >}
  1513. >
  1514. >
  1515. >Off the top of my head so check the function calls in case I remembered
  1516. >them wrong.
  1517. >
  1518.     This code works, but mystifies me. Can someone please explain what
  1519. copy bits does here? It is reading and writing to the same block of memory?
  1520. Does it actually DO the memory writing, or is the instruction just recorded...
  1521. in this case how does the picture know how to execute the instruction? Of
  1522. course, I guess that the PICT must actually just get the bits in the picture
  1523. written to it, but how?
  1524.  
  1525.     Sorry for the ignorance, but thanks for you explanations!
  1526.  
  1527.     Jim Meiss
  1528.     jdm@boulder.colorado.edu
  1529.  
  1530. +++++++++++++++++++++++++++
  1531.  
  1532. >From u9119523@sys.uea.ac.uk (Graham Cox)
  1533. Date: Tue, 19 Apr 1994 10:59:45 GMT
  1534. Organization: School of Information Systems, UEA, Norwich
  1535.  
  1536. In article <2orraa$6es@lace.Colorado.EDU>, jdm@newton (James D. Meiss)
  1537. wrote:
  1538.  
  1539. > In article <u9119523-140494112331@case10.sys.uea.ac.uk> u9119523@sys.uea.ac.uk (Graham Cox) writes:
  1540. > >
  1541. > >
  1542. > >PicHandle MakeWindowPict(WindowPtr theWindow)
  1543. > >{
  1544. > >
  1545. > >    Rect        r;
  1546. > >    PicHandle    p;
  1547. > >
  1548. > >
  1549. > >
  1550. > >    GetPort(&originalPort);
  1551. > >    SetPort(theWindow);
  1552. > >    r = thePort->portRect;
  1553. > >    p = OpenPicture(&r);
  1554. > >    CopyBits(&thePort->portBits,&thePort->portBits,&r,&r,srcCopy,NULL);
  1555. > >    ClosePicture();
  1556. > >    SetPort(originalPort);
  1557. > >    return(p);
  1558. > >}
  1559. > >
  1560. > >
  1561. > >Off the top of my head so check the function calls in case I remembered
  1562. > >them wrong.
  1563. > >
  1564. >     This code works, but mystifies me. Can someone please explain what
  1565. > copy bits does here? It is reading and writing to the same block of memory?
  1566. > Does it actually DO the memory writing, or is the instruction just recorded...
  1567. > in this case how does the picture know how to execute the instruction? Of
  1568. > course, I guess that the PICT must actually just get the bits in the picture
  1569. > written to it, but how?
  1570. >     Sorry for the ignorance, but thanks for you explanations!
  1571. >     Jim Meiss
  1572. >     jdm@boulder.colorado.edu
  1573.  
  1574.  
  1575. As you correctly guessed, the copybits call is made just so that it gets
  1576. recorded into the picture- I think it does actually write over itself as
  1577. well but of course that doesn't matter. When you copybits with an open
  1578. picture, the picture records both the copybits opcode AND all of the actual
  1579. pixel data (and colour tables too- what a bonus!) When played back
  1580. DrawPicture knows that the port in question has changed and does the 'right
  1581. thing'. Stuff like this is why I'll never be a Windows programmer...
  1582.  
  1583. - ------------------------------------------------------------------------
  1584. Love & BSWK, Graham
  1585.  
  1586. -Everyone is entitled to their opinion, no matter how wrong they may be...
  1587. - ------------------------------------------------------------------------
  1588.  
  1589. +++++++++++++++++++++++++++
  1590.  
  1591. >From pottier@corvette.ens.fr (Francois Pottier)
  1592. Date: 19 Apr 1994 14:52:41 GMT
  1593. Organization: Ecole Normale Superieure, PARIS, France
  1594.  
  1595. In article <u9119523-190494135945@case9.sys.uea.ac.uk>,
  1596. Graham Cox <u9119523@sys.uea.ac.uk> wrote:
  1597.  
  1598. >> >    p = OpenPicture(&r);
  1599. >> >    CopyBits(&thePort->portBits,&thePort->portBits,&r,&r,srcCopy,NULL);
  1600.  
  1601. >
  1602. >As you correctly guessed, the copybits call is made just so that it gets
  1603. >recorded into the picture- I think it does actually write over itself as
  1604. >well but of course that doesn't matter.
  1605.  
  1606. No, it doesn't write over itself, it would be a waste. When you call OpenPicture,
  1607. all Quickdraw bottlenecks (the standard drawing routines) are replaced with
  1608. recording routines. So the CopyBits call above is in fact *not* a call to
  1609. the usual CopyBits routine, but to a recording routine. Afterwards, calling
  1610. ClosePicture restores the usual bottlenecks.
  1611.  
  1612. -- 
  1613. Francois Pottier
  1614. pottier@dmi.ens.fr
  1615.  
  1616. ---------------------------
  1617.  
  1618. End of C.S.M.P. Digest
  1619. **********************
  1620.  
  1621.  
  1622.  
  1623.